﻿@using NewLife;
@using NewLife.Web;
@using XCode;
@using System.Linq;
@{
    var page = ViewBag.Page as Pager;
    //var name = (Object)Model + "";
    var name = "";
    if (Model is String str) name = str;
    if (name.IsNullOrEmpty()) name = "enable";

    var dic = new Dictionary<Int32, String>();
    if (name.EqualIgnoreCase("enable"))
    {
        dic.Add(1, "启用");
        dic.Add(0, "禁用");
    }
    else if (name.EqualIgnoreCase("success"))
    {
        dic.Add(1, "成功");
        dic.Add(0, "失败");
    }
    else
    {
        dic.Add(1, "是");
        dic.Add(0, "否");
    }
}
<div class="form-group">
    <label for="@name" class="control-label">状态：</label>
    @await Html.PartialAsync("_Form_DropDownList", new ListBoxModel(name, dic,  page[name], "全部", true, null))
</div>
